package org.gaaidou.ptarmigan.server;

import org.gaaidou.ptarmigan.server.app.DateHandler;
import org.gaaidou.ptarmigan.server.app.PersonHandler;
import org.gaaidou.ptarmigan.server.io.HandlerRouter;
import org.gaaidou.ptarmigan.server.io.Server;

import java.io.IOException;

public class Application {
    public static void main(String[] args) throws InterruptedException {
        HandlerRouter handlerRouter = new HandlerRouter();
        handlerRouter.add("/date", new DateHandler());
        handlerRouter.add("/person", new PersonHandler());
        try {
            Server server = new Server(9999);
            server.setHandlerRouter(handlerRouter);
            server.listen();
        } catch (IOException e) {
            System.exit(-1);
        }
    }
}
